<template>
  <div class="medical-container">
    <div class="medical-assistant">
      <!-- 主要内容区域 -->
      <div class="content-wrapper">
        <!-- 统一的信息卡片 -->
        <div class="info-card">
          <!-- 助手信息 -->
          <div class="assistant-info">
            <div class="greeting-box">
              <h3>您好！我是康小美</h3>
              <p>咨询更快更方便，沟通精彩永不变，探索小域医，您的随身智能小助手！</p>
            </div>
            <div class="potrait">
              <img src="@/assets/img/kxm.png" class="kxm" alt="">
            </div>
          </div>
          <!-- 示例问题区 -->
          <div class="example-section">
            <QuestionExamples @question-selected="handleQuestionSelected" />
          </div>

        </div>
      </div>
      <!-- 将 feature-grid 移到渐变背景外 -->
      <div class="feature-grid-container">
        <feature-grid />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import DocIcon from '@/components/icons/DocIcon'
import LabIcon from '@/components/icons/LabIcon'
import QuestionExamples from '@/views/chat/modules/chat-types/cpns/QuestionExamples.vue'
import DocIcon from '@/components/icons/DocIcon.vue'
import LabIcon from '@/components/icons/LabIcon.vue'
import ClinicalIcon from '@/components/icons/ClinicalIcon.vue'
import FeatureGrid from '@/views/chat/modules/chat-types/cpns/FeatureGrid.vue'

const emits = defineEmits(['select']);
// 获取父组件传值
const props = defineProps({
  type: String
})

const questions = ref([
  { icon: 'icon-doc', text: 'p-tau217' },
  { icon: 'icon-lab', text: 'FT3↓、FT4↓、TSH↑的结果解读' },
  { icon: 'icon-clinical', text: '戈谢病的临床表现有哪些？' }
])
const handleQuestionSelected = (question) => {
  emits('select', question); 
}

</script>

<style scoped lang="scss">
.medical-container {
  width: 100vw;
  /* background-color: #f4f4f4; */
  /* min-height: 100vh; */
  /* padding: 16px; */
  box-sizing: border-box;
  padding-top: 10px;
}

.medical-assistant {
  /* background: white; */
  border-radius: 24px;
  /* min-height: calc(100vh - 32px); */
  /* background: linear-gradient(135deg, #e0f4e7 0%, #d4eef7 100%); */
  position: relative;
  overflow: hidden;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.content-wrapper {
  padding: 26px 16px 10px 16px;
  overflow-y: auto;
  /* height: calc(100vh - 140px); */
}

.info-card {
  background: linear-gradient(135deg, #c1f6f8 0%, #defcfd 30%, #f0f9ff 100%);
  border-radius: 26px;
  padding: 20px 7px 7px 7px;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); */
  position: relative; /* 添加相对定位 */
}

.fish-avatar {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.fish-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.greeting-box {
  padding: 6px 60px 6px 30px;
}
.greeting-box h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
}

.greeting-box p {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}
.example-section {
  padding: 10px 0;
}
/* 响应式适配 */
@media (max-width: 768px) {
  .medical-container {
    padding: 0;
  }

  .medical-assistant {
    border-radius: 0;
    /* height:calc(100vh - 310px); */
    /* min-height: 100vh; */
  }
}

.icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 4px;
  background-color: rgba(74, 144, 226, 0.1);
  padding: 4px;
}

.icon-doc {
  color: #4a90e2;
}

.potrait {
  position: absolute; /* 添加绝对定位 */
  top: -23px; /* 调整顶部距离 */
  right: -15px; /* 调整右侧距离 */
  width: 100px; /* 设置图片宽度 */
  height: 120px; /* 设置图片高度 */
}

.potrait img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保图片覆盖整个容器 */
}

/* 新增 feature-grid 容器样式 */
.feature-grid-container {
  width: 100vw; /* 设置宽度和 medical-container 一样 */
  padding:0 16px 16px 16px; /* 缩小内边距，减少间距 */
  box-sizing: border-box; /* 确保内边距包含在宽度内 */
}
</style>